//
//  NYExamineTestSectionTitltHeader.m
//  NiuWaJiaoYu
//
//  Created by 袁航 on 2018/1/9.
//  Copyright © 2018年 niuwaketang. All rights reserved.
//

#import "NYExamineTestSectionTitltHeader.h"
@interface NYExamineTestSectionTitltHeader ()
@property(nonatomic, strong) TTTAttributedLabel *titleLabel;
@end
@implementation NYExamineTestSectionTitltHeader
- (void)setTestListModel:(NYExamineTestListModel *)testListModel
{
        _testListModel = testListModel;
        [self updateContent];
}
- (void)updateContent
{
        NSAttributedString *attr = [[NSAttributedString alloc] initWithData:[NOT_NULL_STRING_DEFAULT_EMPTY(self.testListModel.ex_title) dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
        self.titleLabel.text = attr.string;
}
- (void)setupView
{
        [super setupView];
        [self.contentView addSubview:self.titleLabel];
        self.contentView.backgroundColor  = [UIColor whiteColor];
        [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.edges.equalTo(self.contentView);
        }];
}
- (TTTAttributedLabel *)titleLabel
{
        if ( _titleLabel == nil )
        {
                _titleLabel = [[TTTAttributedLabel alloc] initWithFrame:CGRectZero];
                _titleLabel.textColor = UIColorHex(0x333333);
                _titleLabel.font = WGSystem18Font;
                _titleLabel.textAlignment = NSTextAlignmentCenter;
        }
        return _titleLabel;
}

@end
